//
//  CJSuccessAuthenticationController.m
//  Boss
//
//  Created by admin on 2018/9/14.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "CJSuccessAuthenticationController.h"
#import "CJOccputionAuthenticationController.h"
@interface CJSuccessAuthenticationController ()
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *topHeight;
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@property (strong, nonatomic) IBOutlet UIView *mainView;
@property (strong, nonatomic) IBOutlet UILabel *nameLabel;


@end

@implementation CJSuccessAuthenticationController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.topHeight.constant = self.navHeight;
    self.navigationItem.title = @"加V认证";
//    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"重新认证" style:(UIBarButtonItemStyleDone) target:self action:@selector(resetAuth:)];
    
    [self checkStatus];
    [self setupUI];
    [self loadData];
    
}
-(void)loadData
{
    WEAKSELF
    [WYHttpServer getNewMyInfoSucessBlock:^(BOOL success, id response, NSString *errorMessage) {
        if (success) {
            WYMyInfo *info = [WYMyInfo getMyInfoFromJson:response[@"result"]];
            [WYStoreModule storeMyInfo:info];
            weakSelf.nameLabel.text = [NSString stringWithFormat:@"您已成功认证 %@ 员工",info.firmName];
        }
        
        
    }];
}


-(void)setupUI
{
    self.mainView.width = kScreenWidth;
    self.mainView.height = kScreenHeight;
    [self.scrollView addSubview:self.mainView];
    self.scrollView.contentSize = self.mainView.size;
    
    
    
    
    
}



-(void)checkStatus
{
    [WYHttpServer checkFirmStatusSucessBlock:^(BOOL success, id response, NSString *errorMessage) {
      
        if (success) {
            
        }
        
        
        
    }];
    
    
    
}


-(void)resetAuth:(UIBarButtonItem *)item
{
    
    CJOccputionAuthenticationController *oac = [[CJOccputionAuthenticationController alloc]init];
    [self.navigationController pushViewController:oac animated:YES];
    
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
